#!/bin/bash

# 健康检查脚本
set -e

HOST=${1:-localhost}
PORT=${2:-3000}
TIMEOUT=${3:-10}

echo "检查应用健康状态: http://$HOST:$PORT/health"

# 检查HTTP响应
if curl -f -s --max-time $TIMEOUT "http://$HOST:$PORT/health" > /dev/null; then
    echo "✅ 应用健康检查通过"
    exit 0
else
    echo "❌ 应用健康检查失败"
    exit 1
fi
